/**
 * Created by zzc on 2017/11/22
 */


'use strict'

import React from 'react';

import {
    Scene,
    Router,
    Actions,
    Reducer,
    ActionConst,
    Overlay,
    Tabs,
    Modal,
    Drawer,
    Stack,
    Lightbox,
} from 'react-native-router-flux';

import {
    StyleSheet
} from 'react-native';

import LoginComponent from "./mine/LoginScene";
import FindHouseDetailScene from "./findhouse/housedetail/FindHouseDetailScene";
import HomeScene from "./home/HomeScene";
import FindHouseScene from "./findhouse/FindHouseScene";
import DiscoverScene from "./discover/DiscoverScene";
import MineScene from "./mine/MineScene";
import TabBar from "../base/widget/TabBar"
import DiscoverDetailScene from "./discover/DiscoverDetailScene";
import BaseScene from "../base/BaseScene";



const AppRouter = ()=>{
    return (
        <Router>
            <Overlay key="overlay">
                <Scene key={"root"} hideNavBar={true} >
                    <Scene key="main" initial>
                        <Tabs
                            key="tabBar"
                            swipeEnabled={false}
                            showLabel={false}
                            lazy = {false}
                            tabBarPosition = "bottom">

                            <Scene
                                key="tab_home"
                                component={HomeScene}
                                title="首页"
                                hideNavBar
                                icon={TabBar}/>

                            <Scene
                                key="tab_find_house"
                                component={FindHouseScene}
                                hideNavBar
                                icon={TabBar}/>

                            <Scene
                                key="tab_discovery"
                                component={DiscoverScene}
                                title="发现"
                                titleStyle={styles.title}
                                icon={TabBar}/>

                            <Scene
                                key="tab_mine"
                                component={MineScene}
                                hideNavBar
                                icon={TabBar}/>
                        </Tabs>
                    </Scene>

                    <Scene
                        key="houseDetail"
                        component={FindHouseDetailScene}
                        hideNavBar/>

                    <Scene
                        key="login"
                        component={LoginComponent}
                        hideNavBar/>

                    <Scene
                        key="discoverDetail"
                        component={DiscoverDetailScene}
                        title="发现"
                        titleStyle={styles.title}/>
                </Scene>
            </Overlay>
        </Router>
    )
}

const styles = StyleSheet.create({
    image: {
        height: 25,
        width: 25,
    },
    title:{
        alignItems:"center",
        justifyContent:"center",
        textAlign:"center",
        color: "black",
        fontSize:17,
        fontWeight:"normal",
        alignSelf: "center",
    }
});

export default AppRouter;